<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>
<%
	String str1 = (String)request.getAttribute("tbXmlString");
	String str2 = (String)request.getAttribute("hbXmlString");	
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
  	<base href="<%=basePath%>"/>
    <title>系统通知汇总</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath+Util.SKIN%>/css/right.css">
	<script src="<%=basePath%>/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="<%=basePath%>/js/oa.js" type="text/javascript"></script>
    <script src="<%=basePath%>/js/dbdialog/lhgdialog.js" type="text/javascript"></script>
	<script src="<%=basePath%>/js/checkbox1.js" type="text/javascript"></script>
	<script type="text/javascript" src="<%=basePath%>/js/selected.js"></script>
	<script type="text/javascript" src="/dySafety/js/My97DatePicker/WdatePicker.js" defer="defer"></script>
	<style type="text/css">
		.hideclass{display:none;}
	</style>
	<script type="text/javascript">
		function funChange(v){	//	table or charts
	 		if(v=="1"){
				$("#hid").addClass("hideClass");
				$("#accidentTj").removeClass("hideClass");
			}else if(v=="2"){
	    		$("#accidentTj").addClass("hideClass");
	 			$("#hid").removeClass("hideClass");
				document.form1.strXml.value="<%=str1%>" ;
				document.form1.target="show";
				document.form1.submit();
			}else if(v=="3"){
	    		$("#accidentTj").addClass("hideClass");
	 			$("#hid").removeClass("hideClass");
				document.form1.strXml.value="<%=str2%>" ;
				document.form1.target="show";
				document.form1.submit();
			}
  		}
		
		$(function(){
			initSelArray('cUnit:1','cDept:1');
			var cGrade = '${cGrade}';
			var cUnit = '${cUnit}';
			var cDept = '${cDept}';
			if(null!=cGrade && cGrade!=""){
				changeGrade(cGrade);
			}
	   		if(cUnit!=null && cUnit!=""){
	   			changeUnit(cUnit);
	   			selected('cUnit',cUnit);	//加载选中部门
	   		}
	   		if(cDept!=null && cDept!=""){
	   			selected('cDept',cDept);	//加载选中单位
	   		}
		});
		function changeGrade(rid){
	   		var urls='<%=basePath%>/tjfx/call_loadDept.action?gradeId='+rid
	   		buildSelect(rid, 'cUnit',urls,'1');
	   	}
	   	function changeUnit(uid){
	   		var rid=document.getElementById("cGrade").value;
	   		var urls="<%=basePath%>/tjfx/call_loadDept.action?unitId="+uid+"&gradeId="+rid;
	   		buildSelect(uid, 'cDept',urls,'1');
	   	}
	</script>
  </head>
  <body>
	<div class="body-box">
			<div class="map">
				<div class="map_con">
					<b>当前位置：</b> 统计分析 &gt; 系统提醒 &gt; 管理部门发送统计
				</div>
			</div>
		<div id="container">	
			<div class="top_search">
				<fieldset>
				<legend>统计条件</legend>
					<form action="<%=basePath %>/tjfx/manageCall_TjManageCall.action" name="from1" method="post">
						<label style="margin-left: 8px;width: 60px;">上报类型：</label>
						<s:select list="gradeList" name="cGrade" listKey="id" listValue="gradeName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:154px;margin-left:5px;" id="cGrade" onchange="changeGrade(this.value);"></s:select>
			   			<s:select list="#{}" name="cUnit" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:154px;margin-left:13px;" id="cUnit" onchange="changeUnit(this.value);"></s:select>
			   			<s:select list="#{}" name="cDept" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:154px;margin-left:13px;" id="cDept"></s:select><br/>
			   			<label style="margin-left: 8px;width: 60px;">上报时间：</label>
			   			<input name="beginTime" id="time1" class="Wdate" type="text" value="${beginTime }" readonly="readonly" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')}'})"/>--<input style="margin-right:9px;" name="endTime" id="time2" class="Wdate" readonly="readonly" type="text" value="${endTime }" onClick="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}'})"/>
						<input type="submit" value="查 询" class="link_input"><br/>
					</form>
					<form action="<%=basePath%>/FusionCharts/RunmaxChartReport3.jsp?strWidth=650" target="show" name="form1" method="post">
						<input type="radio" name="rad1"  value="1" checked="checked" onclick="funChange(this.value);">表格展示
						<input type="radio" name="rad1" value="2" onclick="funChange(this.value);">图形展示(同比)&nbsp;&nbsp;
						<input type="radio" name="rad1" value="3" onclick="funChange(this.value);">图形展示(环比)
						<input type="hidden" id="strXml" name="strXml" />
					</form>
				</fieldset>
			</div>	
			<div id="accidentTj">
			<span>${tip}</span>
			<table cellspacing="0" width="100px" class="mytable" >
				<tbody>
					<tr class="fixedHeaderTr">
						<th height="34" width="300">部门名称</th>
						<th height="34" width="208">发送数</th>
						<th height="34" width="208">百分比</th>
						<th height="34" width="208">同比</th>
						<th height="34" width="208">环比</th>
					</tr>
				<s:if test="%{resultList.size>0}">
					<s:iterator value="resultList" id="obj" status="x">
					<tr align="center">
						<td height="34" width="350">&nbsp;
							<s:if test="%{#obj.showName != '合计'}">
								<a href="<%=basePath%>/tjfx/userCall_TjUserCall.action?beginTime=${beginTime }&endTime=${endTime }&showId=${obj.showId }">${obj.showName}</a>
							</s:if>
							<s:else>
								${obj.showName }
							</s:else>
						</td>
						<td height="34" width="208">&nbsp;
							${obj.privateCount}
						</td>
						<td height="34" width="208">&nbsp;
							${obj.percent}
						</td>
						<td height="34" width="208">&nbsp;
							${obj.tbPercent}
						</td>
						<td height="34" width="208">&nbsp;
							${obj.hbPercent}
						</td>
					</tr>
					</s:iterator>
					<tr>
						<td colspan="5">
							<form target="_blank" method="post" action="<%=basePath%>/tjfx/manageCall_initExcel.action?pageFlag=manageCall&beginTime=${beginTime }&endTime=${endTime }&cGrade=${cGrade }&showId=${showId }">
								<input type="submit" value="导出Excel" class="link_input"><br/>
							</form>
						</td>
					</tr>
				</s:if>
				<s:else>
					<tr>
						<td class="s41" height="34" width="219" colspan="5" style="text-align: center;">没有数据</td>
					</tr>
				</s:else>
			</tbody>
		</table>
	</div>
	<iframe id="hid" src="" name="show" marginWidth=0 marginHeight=0  frameBorder=0 width=100% scrolling=no height=5 onload="this.height=this.contentWindow.document.body.scrollHeight"></iframe>
  </div>		    
  <div class="right_bottom">
	<div style="width:11px;float:left"><img src="<%=request.getContextPath() %>/images/right_bottom.gif"/></div>
	<div style="width:16px;float:right"><img src="<%=request.getContextPath()%>/images/right_rbottom.gif"/></div>
  </div>
  </body>
</html>
